import {get} from '../get'
import {request} from '../request'

export const getMenu = () => {
  return get.get('/role/menu')
}

export const getAllRole = () => {
  return get.get('/role')
}

export const addRole = (roleName) => {
  return request.post('/role', {
    name: roleName
  })
}

export const updateRole = (role) => {
  return request.put('/role', role)
}

export const deleteRole = (roleId) => {
  return request.delete(`/role/${roleId}`)
}